package com.tcp2.frame.taxi;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Author: <陈景阳>
 * Time: 2015-09-18 15:13
 * Copyright (C) 2013 Xiamen Yaxon Networks CO.,LTD.
 * 上报签到信息上传界面
 */
public class Frame0B03 {

    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date time=new Date();

    //TODO:缺少位置信息

    //企业经营许可证号
    public JTextField licenseField = new JTextField("1200000000000000");

    //驾驶员从业资格证号
    public JTextField driverNoField = new JTextField("2600000000000000000");

    //开机时间
    public JTextField dateField = new JTextField(format.format(time));

    //主容器
    public JPanel jp;


    public Frame0B03(JPanel parent){
        this.jp = parent;
    }

    public void init(){
        Box box1 = Box.createHorizontalBox();
        JLabel jlDesc = new JLabel("功能描述：上报签到信息上传,基本位置信息自动生成。消息ID=0x0B03");
        box1.add(jlDesc);

        JPanel jp1 = new JPanel();
        TitledBorder t1 = new TitledBorder("上报签到信息上传");
        jp1.setBorder(t1);

        JLabel l1 = new JLabel("企业经营许可证号:   ");
        Box box2 = Box.createHorizontalBox();
        box2.add(l1);
        box2.add(licenseField);

        JLabel l2 = new JLabel("驾驶员从业资格证号: ");
        Box box3 = Box.createHorizontalBox();
        box3.add(l2);
        box3.add(driverNoField);

        JLabel l4 = new JLabel("开机时间:   ");
        Box box5 = Box.createHorizontalBox();
        box5.add(l4);
        box5.add(Box.createHorizontalStrut(47));
        box5.add(dateField);

        Box box6 = Box.createVerticalBox();
        box6.add(Box.createVerticalStrut(10));
        box6.add(box2);
        box6.add(Box.createVerticalStrut(10));
        box6.add(box3);
        box6.add(Box.createVerticalStrut(10));
        box6.add(box5);
        box6.add(Box.createHorizontalStrut(300));

        jp1.add(box6);

        Box vBox = Box.createVerticalBox();
        box6.add(Box.createVerticalStrut(10));
        vBox.add(box1);
        box6.add(Box.createVerticalStrut(10));
        vBox.add(jp1);

        jp.add(vBox,"p5");
    }
}
